<h2 class="contentTitle">添加/修改品牌</h2>
<style>
	.pageFormContent dl dt{width:100px;}
	.pageFormContent dl dd{width:220px;}
</style>
<div class="pageContent">
    {if $action_name=='add'}
    <form id="myform" method="post" action="{:U($module_name.'/insert')}" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone);">
    {else}
    <form id="myform" method="post" action="{:U($module_name.'/update')}" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone);">
        {if $info['id']}<input type="hidden" name="id" value="{$info['id']}" />{/if}
    {/if}
        <div class="pageFormContent nowrap" layoutH="97">
            <dl>
                <dt>状态：</dt>
                <dd>
                    <select name="status" class="required" alt="请选择状态">
                        <option value="1">请选择品牌</option>
                        <volist name="status" id='s'>
                        <option value="{$key}" {if $info['status']&&$key==$info['status']}selected='selected'{/if}>{$s} </option>
                        </volist>
                    </select>
                </dd>
            </dl>
            <dl>
                <dt>品牌名称：</dt>
                <dd><input type="text" name="name" maxlength="20" class="required autoinput" style="float: none;" data-validate="validate(required);" {if !$info['name']}
 remote="{:U($module_name.'/field_exist',array('tn'=>'ProductBrand','fn'=>'name'))}"{/if}
 placeholder="请输入品牌名称" value="{$info['name']}"/></dd>
            </dl>
            <dl>
                <dt>品牌别名：</dt>
                <dd><input type="text" name="alias" class="autoinput" placeholder="请输入别名" value="{$info['alias']}" style="float: none;" /></dd>
            </dl>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                保存
                            </button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                取消
                            </button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script>
    $(function(){
        $.ketchup.createErrorContainer(function(form, el) {
            return $('<ul/>', {
                    'class': 'ketchup-custom'
                    }).insertAfter(el);
        }).addErrorMessages(function(form, el, container, messages) {
            container.html('');

            for(i = 0; i < messages.length; i++) {
            $('<li/>', {
                text: messages[i]
            }).appendTo(container);
            }
        }).showErrorContainer(function(form, el, container) {
            container.slideDown('fast');
        }).hideErrorContainer(function(form, el, container) {
            container.slideUp('fast');
        });

        $('#myform').ketchup({
            validateEvents: 'blur keyup'
        });    
    })
</script>